<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <meta>
  <!-- Stylesheets -->
  <link href="../web.css" type="text/css" rel="stylesheet"></link>
  <link href="../pygmentize.css" type="text/css" rel="stylesheet"></link>
  <title>VLFeat - Documentation - C API</title>
  <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>

  <!-- Scripts-->
  
 </meta>

 <!-- Body Start -->
 <body>
  <div id="header">
   <!-- Google CSE Search Box Begins -->
   <form action="http://www.vlfeat.org/search.html" method="get" id="cse-search-box" enctype="application/x-www-form-urlencoded">
    <div>
     <input type="hidden" name="cx" value="003215582122030917471:oq23albfeam"></input>
     <input type="hidden" name="cof" value="FORID:11"></input>
     <input type="hidden" name="ie" value="UTF-8"></input>
     <input type="text" name="q" size="31"></input>
     <input type="submit" name="sa" value="Search"></input>
    </div>
   </form>
   <script src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en" xml:space="preserve" type="text/javascript"></script>
   <!-- Google CSE Search Box Ends -->
   <h1><a shape="rect" href="../index.html" class="plain"><span id="vlfeat">VLFeat</span><span id="dotorg">.org</span></a></h1>
  </div>
  <div id="headbanner">
   Documentation - C API
  </div>
  <div id="pagebody">
   <div id="sidebar"> <!-- Navigation Start -->
    <ul>
<li><a href="../index.html">Home</a>
</li>
<li><a href="../download.html">Download</a>
</li>
<li><a href="../doc.html">Documentation</a>
<ul>
<li><a href="../mdoc/mdoc.html">Matlab API</a>
</li>
<li><a href="index.html" class='active' >C API</a>
</li>
<li><a href="../man/man.html">Man pages</a>
</li>
</ul></li>
<li><a href="../overview/tut.html">Tutorials</a>
</li>
<li><a href="../applications/apps.html">Applications</a>
</li>
</ul>

   </div> <!-- sidebar -->
   <div id="content">
    
    <link rel="stylesheet" type="text/css" href="../doxygen.css"></style>
    <div class="doxygen">
<div>
<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">kdtree.h File Reference</div>  </div>
</div>
<div class="contents">

<p>KD-tree (<a class="el" href="kdtree.html">KD-trees and forests</a>)  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="generic_8h.html">generic.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="mathop_8h.html">mathop.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structVlKDForestNeighbor.html">VlKDForestNeighbor</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Neighbor of a query point.  <a href="structVlKDForestNeighbor.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structVlKDForest.html">VlKDForest</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">KDForest object.  <a href="structVlKDForest.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364">VlKDTreeThresholdingMethod</a> </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Thresholding method. <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Creatind and disposing</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#af0e747c0b4e989d2800e17eb2b9fd6ec">vl_kdforest_new</a> (vl_type dataType, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> dimension, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numTrees)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create new KDForest object.  <a href="#af0e747c0b4e989d2800e17eb2b9fd6ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a68bcecfea6e63a41aafbd5ea9ca1a418">vl_kdforest_delete</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete KDForest object.  <a href="#a68bcecfea6e63a41aafbd5ea9ca1a418"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Building and querying</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#ac886f1fd6024a74e9e4a5d7566b2125f">vl_kdforest_build</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numData, void const *data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Build KDTree from data.  <a href="#ac886f1fd6024a74e9e4a5d7566b2125f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a2af87b58193ea0314fa971f8678e4e8c">vl_kdforest_query</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self, <a class="el" href="structVlKDForestNeighbor.html">VlKDForestNeighbor</a> *neighbors, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> numNeighbors, void const *query)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Query operation.  <a href="#a2af87b58193ea0314fa971f8678e4e8c"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Retrieving and setting parameters</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a55728e3e3e7a3619ed24e8b016dbf2a4">vl_kdforest_get_depth_of_tree</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self, <a class="el" href="host_8h.html#ac13bd3cc913e1da576e189a3ec8d66fc">vl_uindex</a> treeIndex)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the detph of a given tree.  <a href="#a55728e3e3e7a3619ed24e8b016dbf2a4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a766017f8aefa345762c3503f6a2b0b75">vl_kdforest_get_num_nodes_of_tree</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self, <a class="el" href="host_8h.html#ac13bd3cc913e1da576e189a3ec8d66fc">vl_uindex</a> treeIndex)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of nodes of a given tree.  <a href="#a766017f8aefa345762c3503f6a2b0b75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a054701571177903a5369bb73da3139ef">vl_kdforest_get_num_trees</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of trees in the forest.  <a href="#a054701571177903a5369bb73da3139ef"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a548f72a02684f50ed2fc5d54e256b752">vl_kdforest_get_data_dimension</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the dimension of the data.  <a href="#a548f72a02684f50ed2fc5d54e256b752"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">vl_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#abba39fcd9a3693e9c8851b0b008c2db0">vl_kdforest_get_data_type</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the data type.  <a href="#abba39fcd9a3693e9c8851b0b008c2db0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#a4bf926f9406cec740d564b703236c68d">vl_kdforest_set_max_num_comparisons</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self, <a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> n)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the maximum number of comparisons for a search.  <a href="#a4bf926f9406cec740d564b703236c68d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#af0d6436d4b42826cf4aaf50b2ec59b53">vl_kdforest_get_max_num_comparisons</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the maximum number of comparisons for a search.  <a href="#af0d6436d4b42826cf4aaf50b2ec59b53"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#adf66cf1b6be55d82a2ad4d568271f157">vl_kdforest_set_thresholding_method</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> *self, <a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364">VlKDTreeThresholdingMethod</a> method)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the thresholding method.  <a href="#adf66cf1b6be55d82a2ad4d568271f157"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364">VlKDTreeThresholdingMethod</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="kdtree_8h.html#ac153ede5b0d8716f2ae7887ef7060884">vl_kdforest_get_thresholding_method</a> (<a class="el" href="structVlKDForest.html">VlKDForest</a> const *self)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the thresholding method.  <a href="#ac153ede5b0d8716f2ae7887ef7060884"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Andrea Vedaldi </dd></dl>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="ac886f1fd6024a74e9e4a5d7566b2125f"></a><!-- doxytag: member="kdtree.h::vl_kdforest_build" ref="ac886f1fd6024a74e9e4a5d7566b2125f" args="(VlKDForest *self, vl_size numData, void const *data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_kdforest_build </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDTree object </td></tr>
    <tr><td class="paramname">numData</td><td>number of data points. </td></tr>
    <tr><td class="paramname">data</td><td>pointer to the data.</td></tr>
  </table>
  </dd>
</dl>
<p>The function builds the KDTree by processing the data <em>data</em>. For efficiency, KDTree does not copy the data, but retains a pointer to it. Therefore the data must survive (and not change) until the KDTree is deleted. </p>

</div>
</div>
<a class="anchor" id="a68bcecfea6e63a41aafbd5ea9ca1a418"></a><!-- doxytag: member="kdtree.h::vl_kdforest_delete" ref="a68bcecfea6e63a41aafbd5ea9ca1a418" args="(VlKDForest *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_kdforest_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object to delete </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="kdtree_8h.html#af0e747c0b4e989d2800e17eb2b9fd6ec" title="Create new KDForest object.">vl_kdforest_new</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a548f72a02684f50ed2fc5d54e256b752"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_data_dimension" ref="a548f72a02684f50ed2fc5d54e256b752" args="(VlKDForest const *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_get_data_dimension </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>dimension of the data. </dd></dl>

</div>
</div>
<a class="anchor" id="abba39fcd9a3693e9c8851b0b008c2db0"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_data_type" ref="abba39fcd9a3693e9c8851b0b008c2db0" args="(VlKDForest const *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vl_type vl_kdforest_get_data_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>data type (one of <a class="el" href="generic_8h.html#aa034d0b942f9800b2a02aeb30ff10fa2">VL_TYPE_FLOAT</a>, <a class="el" href="generic_8h.html#a41d6691dac0cc3648ca9701d27e5d2b0">VL_TYPE_DOUBLE</a>). </dd></dl>

</div>
</div>
<a class="anchor" id="a55728e3e3e7a3619ed24e8b016dbf2a4"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_depth_of_tree" ref="a55728e3e3e7a3619ed24e8b016dbf2a4" args="(VlKDForest const *self, vl_uindex treeIndex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_get_depth_of_tree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#ac13bd3cc913e1da576e189a3ec8d66fc">vl_uindex</a>&#160;</td>
          <td class="paramname"><em>treeIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
    <tr><td class="paramname">treeIndex</td><td>index of the tree. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of trees. </dd></dl>

</div>
</div>
<a class="anchor" id="af0d6436d4b42826cf4aaf50b2ec59b53"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_max_num_comparisons" ref="af0d6436d4b42826cf4aaf50b2ec59b53" args="(VlKDForest *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_get_max_num_comparisons </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>maximum number of leaves.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="kdtree_8h.html#a4bf926f9406cec740d564b703236c68d" title="Set the maximum number of comparisons for a search.">vl_kdforest_set_max_num_comparisons</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="a766017f8aefa345762c3503f6a2b0b75"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_num_nodes_of_tree" ref="a766017f8aefa345762c3503f6a2b0b75" args="(VlKDForest const *self, vl_uindex treeIndex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_get_num_nodes_of_tree </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#ac13bd3cc913e1da576e189a3ec8d66fc">vl_uindex</a>&#160;</td>
          <td class="paramname"><em>treeIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
    <tr><td class="paramname">treeIndex</td><td>index of the tree. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of trees. </dd></dl>

</div>
</div>
<a class="anchor" id="a054701571177903a5369bb73da3139ef"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_num_trees" ref="a054701571177903a5369bb73da3139ef" args="(VlKDForest const *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_get_num_trees </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of trees. </dd></dl>

</div>
</div>
<a class="anchor" id="ac153ede5b0d8716f2ae7887ef7060884"></a><!-- doxytag: member="kdtree.h::vl_kdforest_get_thresholding_method" ref="ac153ede5b0d8716f2ae7887ef7060884" args="(VlKDForest const *self)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364">VlKDTreeThresholdingMethod</a> vl_kdforest_get_thresholding_method </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> const *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>thresholding method.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="kdtree_8h.html#adf66cf1b6be55d82a2ad4d568271f157" title="Set the thresholding method.">vl_kdforest_set_thresholding_method</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af0e747c0b4e989d2800e17eb2b9fd6ec"></a><!-- doxytag: member="kdtree.h::vl_kdforest_new" ref="af0e747c0b4e989d2800e17eb2b9fd6ec" args="(vl_type dataType, vl_size dimension, vl_size numTrees)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structVlKDForest.html">VlKDForest</a>* vl_kdforest_new </td>
          <td>(</td>
          <td class="paramtype">vl_type&#160;</td>
          <td class="paramname"><em>dataType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>dimension</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numTrees</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dataType</td><td>type of data (<a class="el" href="generic_8h.html#aa034d0b942f9800b2a02aeb30ff10fa2">VL_TYPE_FLOAT</a> or VL_TYPE_DOUBLE) </td></tr>
    <tr><td class="paramname">dimension</td><td>data dimensionality. </td></tr>
    <tr><td class="paramname">numTrees</td><td>number of trees in the forest. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>new KDForest. </dd></dl>

</div>
</div>
<a class="anchor" id="a2af87b58193ea0314fa971f8678e4e8c"></a><!-- doxytag: member="kdtree.h::vl_kdforest_query" ref="a2af87b58193ea0314fa971f8678e4e8c" args="(VlKDForest *self, VlKDForestNeighbor *neighbors, vl_size numNeighbors, void const *query)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a> vl_kdforest_query </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structVlKDForestNeighbor.html">VlKDForestNeighbor</a> *&#160;</td>
          <td class="paramname"><em>neighbors</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>numNeighbors</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void const *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDTree object instance. </td></tr>
    <tr><td class="paramname">neighbors</td><td>list of nearest neighbors found (output). </td></tr>
    <tr><td class="paramname">numNeighbors</td><td>number of nearest neighbors to find. </td></tr>
    <tr><td class="paramname">query</td><td>query point. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of tree leaves visited.</dd></dl>
<p>A neighbor is represented by an instance of the structure <a class="el" href="structVlKDForestNeighbor.html" title="Neighbor of a query point.">VlKDForestNeighbor</a>. Each entry contains the index of the neighbor (this is an index into the KDTree data) and its distance to the query point. Neighbors are sorted by increasing distance. </p>

</div>
</div>
<a class="anchor" id="a4bf926f9406cec740d564b703236c68d"></a><!-- doxytag: member="kdtree.h::vl_kdforest_set_max_num_comparisons" ref="a4bf926f9406cec740d564b703236c68d" args="(VlKDForest *self, vl_size n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_kdforest_set_max_num_comparisons </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="host_8h.html#a0ee26101458c663510d620e3ee7e2555">vl_size</a>&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
    <tr><td class="paramname">n</td><td>maximum number of leaves.</td></tr>
  </table>
  </dd>
</dl>
<p>This function sets the maximum number of comparisons for a nearest neighbor search. Setting it to 0 means unbounded comparisons.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="kdtree_8h.html#a2af87b58193ea0314fa971f8678e4e8c" title="Query operation.">vl_kdforest_query</a>, <a class="el" href="kdtree_8h.html#af0d6436d4b42826cf4aaf50b2ec59b53" title="Get the maximum number of comparisons for a search.">vl_kdforest_get_max_num_comparisons</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="adf66cf1b6be55d82a2ad4d568271f157"></a><!-- doxytag: member="kdtree.h::vl_kdforest_set_thresholding_method" ref="adf66cf1b6be55d82a2ad4d568271f157" args="(VlKDForest *self, VlKDTreeThresholdingMethod method)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vl_kdforest_set_thresholding_method </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structVlKDForest.html">VlKDForest</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364">VlKDTreeThresholdingMethod</a>&#160;</td>
          <td class="paramname"><em>method</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>KDForest object. </td></tr>
    <tr><td class="paramname">method</td><td>one of <a class="el" href="kdtree_8h.html#a7132289873fbe45803ce724beaa74364" title="Thresholding method.">VlKDTreeThresholdingMethod</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="kdtree_8h.html#ac153ede5b0d8716f2ae7887ef7060884" title="Get the thresholding method.">vl_kdforest_get_thresholding_method</a> </dd></dl>

</div>
</div>
</div>
     <!-- Doc Here -->
    </div>
   
   </div>
   <div class="clear">&nbsp;</div>
  </div> <!-- pagebody -->
  <div id="footer">
   &copy; 2007-12 Andrea Vedaldi and Brian Fulkerson
  </div> <!-- footer -->

  <!-- Google Analytics Begins -->
  <script xml:space="preserve" type="text/javascript">
   //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   }
   //]]>
  </script>
  <script xml:space="preserve" type="text/javascript">
    //<![CDATA[
    var localre = /vlfeat.org/;
    if(document.location.host.search(localre) != -1)
    {

   try {
   var pageTracker = _gat._getTracker("UA-4936091-2");
   pageTracker._trackPageview();
   } catch(err) {}

   }
   //]]>
  </script>
  <!-- Google Analytics Ends -->
 </body>
</html>

 
